﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Gueei.Gallery.Core.Entities;

namespace Gueei.Gallery.Web.ViewModels
{
	public class AlbumListViewModel:List<AlbumViewModel>
	{
		public PagingViewModel Paging { get; set; }
	}

	public class AlbumViewModel
	{
		public Guid Id { get; set; }
		public string Name { get; set; }
		public ImageViewModel CoverImage { get; set; }
		public int ImageCount { get; set; }

		public static AlbumViewModel CreateFromAlbum(Album album)
		{
			return new AlbumViewModel
			       	{
						Id = album.Id,
						Name = album.Name,
						CoverImage = ImageViewModel.CreateFromImage(album.CoverImage),
						ImageCount = album.Images.Count
			       	};
		}
	}
}